{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "antique-treasure",
   "metadata": {},
   "source": [
    "# User Automated Testing\n",
    "\n",
    "A notebook to run manually to catch issues with the backend."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "binary-speaker",
   "metadata": {},
   "source": [
    "# 1. Checking plt.show()\n",
    "\n",
    "The implementation of plt.show relies on the private `matplotlib._pylab_helpers.Gcf` which can break (https://github.com/matplotlib/ipympl/issues/303). The cell should run without any errors."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "agricultural-whole",
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib ipympl\n",
    "import matplotlib.pyplot as plt\n",
    "plt.ioff()\n",
    "fig = plt.figure()\n",
    "plt.plot([0,1],[0,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "secure-consistency",
   "metadata": {},
   "source": [
    "# 2 plt.close()\n",
    "\n",
    "Calling `plt.close()` should prevent further interactions with the figure - so panning and resizing should no longer work after the second cell in this test."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "hollow-front",
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.ion()\n",
    "plt.figure()\n",
    "plt.plot([0,1],[0,1])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "classical-pavilion",
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.close()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
